package View;

import Control.login;
import Control.register;
import Model.User;
import Model.User_Visitor;

import java.io.IOException;
import java.util.Scanner;

import static Control.main.userList;

/*
Menu类：
欢迎显示方法：public static void welcome()
菜单显示方法：public static void menuPrint()
选择与执行方法：public static boolean execution (int num)
*/
public class Menu {
    static Scanner s = new Scanner(System.in);

    //欢迎显示方法
    public static void welcome() {
        System.out.println("========欢迎使用动物园管理系统========");
    }

    //主菜单显示方法
    public static void menuPrint() {
        System.out.println("1-注册");
        System.out.println("2-登录");
        System.out.println("3-退出");
        System.out.print("请输入序号：");
    }

    //选择与执行方法
    public static void execution () throws IOException {
        int num = s.nextInt();
        switch (num) {
            case 1:
                System.out.println("1-注册");
                User u1 = register.registerPage();
                userList.add(u1);
                break;
            case 2:
                System.out.println("2-登录");
                User u2 = login.loginAccount(userList);
                login.permissionSecondMenu(u2);
                break;
            case 3:
                System.out.println("3-退出");
                System.exit(0);
            default:
                System.out.println("请重新输入！");
                break;
        }
    }








}

